VERSION 5.00
Begin VB.Form frmToolContainer 
   BorderStyle     =   0  'None
   ClientHeight    =   5160
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   5670
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   5160
   ScaleWidth      =   5670
   ShowInTaskbar   =   0   'False
   Begin VB.HScrollBar hsContainer 
      Height          =   240
      Left            =   0
      TabIndex        =   1
      Top             =   4920
      Visible         =   0   'False
      Width           =   5325
   End
   Begin VB.VScrollBar vsContainer 
      Height          =   4830
      Left            =   5370
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.PictureBox picHolder 
      BackColor       =   &H80000015&
      BorderStyle     =   0  'None
      Height          =   4875
      Left            =   0
      ScaleHeight     =   4875
      ScaleWidth      =   5325
      TabIndex        =   2
      Top             =   0
      Width           =   5325
      Begin VB.Timer Timer1 
         Interval        =   100
         Left            =   2880
         Top             =   1440
      End
      Begin VB.PictureBox picContainer 
         BackColor       =   &H8000000C&
         BorderStyle     =   0  'None
         Height          =   1455
         Left            =   0
         ScaleHeight     =   1455
         ScaleWidth      =   1695
         TabIndex        =   3
         Top             =   0
         Width           =   1695
      End
   End
End
Attribute VB_Name = "frmToolContainer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim InputX, InputY As Long
Dim MaxMoveX, MaxMoveY As Long
Dim bolMouseDown As Boolean

'class mode enumeration
Public Enum eToolContainerMode
    Active
    Inactive
End Enum
Public Mode As eToolContainerMode

Public meWidth As Long
Public meHeight As Long

Public meIndex As Integer

Dim lResize(1000) As Boolean

Public objChild As Object

Dim frm As Form


Private Sub Form_Resize()
    If Me.Width = 0 And Me.Height = 0 Then Exit Sub

    picHolder.Width = empWidth - vsContainer.Width
    vsContainer.Left = picHolder.Width
    hsContainer.Top = picHolder.Height
    
    picHolder.Height = empHeight - hsContainer.Height
    vsContainer.Height = picHolder.Height
    hsContainer.Width = picHolder.Width
    
    picContainer.Move 0, 0
    picContainer.Width = ITGLedgerMain.Width
    picContainer.Height = ITGLedgerMain.Height
    
    OnObjChildLoad
    lResize(meIndex) = True
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    lResize(meIndex) = False
End Sub

Private Sub Form_Load()
    If FrmName.Name <> "frmReportViewer" Then
        Settings
    End If
    
    Set objChild = FrmName
    
    Me.Move 0, 0, empWidth, empHeight
    
    Mode = 0

End Sub

Private Sub Settings()
    vsContainer.Enabled = True
    hsContainer.Enabled = True
End Sub

Public Sub OnObjChildLoad()

    With picContainer
        If .Height > picHolder.Height Then
            vsContainer.Visible = True
            MaxMoveY = picHolder.Height - .ScaleHeight
            vsContainer.Max = MaxMoveY
            vsContainer.Min = 0
            vsContainer.Value = -1
        Else
            vsContainer.Visible = False
            MaxMoveY = 0
        End If
        
        If .Width > picHolder.Width Then
            hsContainer.Visible = True
            MaxMoveX = picHolder.Width - .ScaleWidth
            hsContainer.Max = MaxMoveX
            hsContainer.Min = 0
            hsContainer.Value = -1
        Else
            hsContainer.Visible = False
            MaxMoveX = 0
        End If
    
        hsContainer.LargeChange = IIf(ScaleWidth > 0, ScaleWidth, hsContainer.LargeChange)
        vsContainer.LargeChange = IIf(ScaleHeight > 0, ScaleHeight, vsContainer.LargeChange)
    
    End With

End Sub

Private Sub hsContainer_GotFocus()
    picContainer.SetFocus
End Sub

Private Sub hscontainer_Scroll()
  picContainer.Left = hsContainer.Value
End Sub

Private Sub vsContainer_GotFocus()
    picContainer.SetFocus
End Sub

Private Sub vscontainer_Scroll()
    If picContainer.Height > vsContainer.Max Then
        picContainer.Top = vsContainer.Value
    End If
End Sub

Private Sub hscontainer_Change()
    picContainer.Left = hsContainer.Value
End Sub

Private Sub vscontainer_Change()
    picContainer.Top = vsContainer.Value
End Sub

